#include "formabout.h"
#include <QFile>
#include <QTextCodec>


FormAbout::FormAbout(const QString &uri, QWidget *parent) : QDialog(parent), ui(new Ui::FormAbout) {
    ui->setupUi(this);
    QFile file(uri);
    file.open(QIODevice::ReadOnly | QIODevice::Text);
    const QByteArray data = file.readAll();
    file.close();
    const QString text = QTextCodec::codecForHtml(data)->toUnicode(data);
    ui->txtLicense->setText(text);
    ui->lblDesc->setText(tr("<b>RSS Guard</b><br>Version: %1<br>Compiled against Qt %2").arg(qApp->applicationVersion(), QT_VERSION_STR));
    ui->txtInfo->setText(tr("RSS Guard is a tool for reading online RSS 0.92/1.0/2.0 & ATOM 1.0 feeds. It can be minimized to notification area and it can automatically look for new messages and notice you if there are any."
                            "\n\nThis software is distributed under GNU GPLv3 license."
                            "\n\nRSS Guard is made by Martin Rotter."
                            "\n\nMy contacts are:\n  - rotter.martinos(at)gmail  ~email\n  - code.google.com/p/rss-guard ~ rss guard's website\n - www.martin-rotter.8u.cz  ~author's website"
                            "\n\nYou can obtain source code for RSS Guard from its website."
                            "\n\n\nCopyright ©  2011 Martin Rotter"));
}

FormAbout::~FormAbout() {
    delete ui;
}
